gnuplot gnuplot_file.plt
pdflatex pdflatex_file.tex
pdflatex pdflatex_file.tex
if not exist pdflatex_file.pdf (
	echo File pdflatex_file.pdf does not exist. Script exiting.
	pause
	exit /b 1
)
set /a ver=0
set file="Library Report.pdf"
:repeat
set /a ver=ver+1
copy pdflatex_file.pdf %file%
if errorlevel 1 (
	set file="Library Report %ver%.pdf"
	goto :repeat
)
del pdflatex_file.pdf
start "" %file%
pause
